// 导入籍贯图
import { nativePlaceMap } from '../echartsModule/nativePlace.js'
import { gotoGuangzhouMap } from '../echartsModule/gotoGuangzhou.js'

async function init() {
  const list = (await axios('/student/list')).data.data
  console.log(list)
  const arr = []
  list.forEach(item => {
    // console.log(item.province)
    const index = arr.findIndex(i => i.name === item.province)
    // console.log(index)
    if (index === -1) arr.push({ value: 1, name: item.province })
    else arr[index].value += 1
  })

  console.log(arr)
  nativePlaceMap(arr)
  gotoGuangzhouMap()
}
init()
